<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script src="js/jquery-3.4.1.min.js"></script>

    <img src="img/3.jpg" width="400">

    <script>
       /* hover()方法相当于mouseover与mouseout事件的组合 */

       $("img").hover(

           function(){//移动到元素上时
             $(this).css("border","5px solid red");
           },
           function(){//离开元素时
             $(this).css("border","5px solid white");
           },
           
       );
    </script>
</body>
</html>